QTUserData Class
Used to add and retrieve QuickTime user data, such as copyright notice, credits, and miscellaneous information.
More information available in parent classes: Object
Notes
A QuickTime movie can contain user data lists, denoted by the udType parameter. UserData contains additional information about the movie, including copyright information, etc. The QTUserData class is used to manage the user data lists. UserData is a property of EditableMovie.
The udType parameter is a four character code for the type of user data. Apple's currently-defined user data types are shown in the following table:
udType | Description |
©nam | Movie's name. |
©cpy | Copyright statement. |
©day | Date the movie was created. |
©dir | Name of the movie's director. |
©ed1 to ©ed9 | Edit dates and descriptions. |
©fmt | Indication of movie format. |
©inf | Information about the movie. |
©prd | Name of movie's producer. |
©prf | Names of performers. |
©req | Special hardware and software requirements. |
©src | Credits for those who provided movie source content. |
©wrt | Name of movie's writer. |
Apple has reserved all lowercase data type values; however, you can create user data type values using uppercase letters. Apple recommends using type values beginning with the © character to specify user data items that store text data.
It is possible to create more than one user data item in a user data list. Therefore, each user data item is referenced by the Index parameter, where the first item is numbered 1. Please see the example for multiple items within a data type.
You may also provide alternate text for a given user data item, for example, to support multiple languages. The alternate versions are indicated by the value of the Region parameter. It represents a region code. The example shows English and French titles for a movie using the Region parameter.
Examples
The following code adds several performers and a director to the movie and then displays the names of the performers in a ListBox and the director in an EditField. It also adds English and French titles to the movie.
Dim myval as String
Dim i, myint as Integer
Dim f as FolderItem
Dim m as EditableMovie
f= GetFolderItem("FrmAmngTheDead.Mov")
If f <> Nil then
m=f.OpenEditableMovie
//Performers
m.UserData.AddUserData("©prf","Kim Novak")
m.UserData.AddUserData("©prf","James Stewart")
m.UserData.AddUserData("©prf","Barbara Bel Geddes")
m.UserData.AddUserData("©prf","Tom Helmore")
//number of performers
MyInt=m.UserData.UserDataCount("©prf")
//the director...
m.UserData.AddUserData("©dir","Alfred Hitchcock")
//English and French titles
m.UserData.SetUserDataText("©nam",1,"Vertigo",1)
m.UserData.SetUserDataText("©nam",1,"D'Entre les Morts",2)
//display Director's name
mybool=m.UserData.GetUserData("©dir",1,myval)
EditField1.text=myval
//display cast members in ListBox
For i=1 to MyInt
mybool=m.UserData.GetUserData("©prf",i,myval)
ListBox1.AddRow(myval)
Next
end if
See Also
EditableMovie class; MoviePlayer control.